package com.zhumengquan.wozhi.controller;

import com.zhumengquan.wozhi.domain.User;
import com.zhumengquan.wozhi.service.FindUserByNameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class FindUserByNameController {
    @Autowired
    public FindUserByNameService findUserByNameService;
    @RequestMapping("/finduserbyname")
    @ResponseBody
    public User FindUserByName (@RequestParam(value = "name", required = true) String name){
        User result =findUserByNameService.getUser(name);
        return result;
    }
}
